# Licensed under the GNU General Public License, version 2.
# See the file http://www.gnu.org/licenses/gpl.txt
def cutter(cut_with,aacidsequence)
     if cut_with.length > 3
  puts "We have just 3 enzymes so you can't use more than 3 times."
     else 

      puts "Analyzing..."
      puts "==================="
      n = 0
result = "true"
         while n != cut_with.length

             if cut_with[n] == "Trypsin"
aacidsequence = aacidsequence.gsub('Arg', 'ArgSPLITME').gsub('Lys', 'LysSPLITME')

n = n+1


             elsif cut_with[n] == "Chymotrypsin"
aacidsequence = aacidsequence.gsub('Phe', 'PheSPLITME').gsub('Trp ', 'TrpSPLITME').gsub('Tyr', 'TyrSPLITME')
n = n+1

             elsif cut_with[n] == "Pepsin"
aacidsequence = aacidsequence.gsub('Phe', 'SPLITMEPhe').gsub('Trp', 'SPLITMETrp').gsub('Tyr', 'SPLITMETyr')
n = n+1

             else
puts "Be sure that you write the enzyme names true."
exit
             end
         end
      end

    if result == "true"

print "Your polypeptide chain has been cutted with '#{cut_with.join(" ")}' and this aminoacid/aminoacid chains made after the operation:\n"
puts "==================="
aacidsequence = aacidsequence.gsub('SPLITME SPLITME', 'SPLITME').split('SPLITME')
x = 0
		while x != aacidsequence.length

puts aacidsequence[x].gsub(/^\s/, "")

x = x + 1
		end
puts "==================="
    else 
exit
    end
end